Suppose I have a table called 'logs' in mysql and I want to get the create query of this table in Qt(5.2 mingw). Here is what I have done so far:
After executing the code, the query.exec() returns true but the query.next() returns false. This query executes successfully in the mysql client(navicat) so I'm pretty sure about the query.Qt Code:
query.prepare("SHOW CREATE TABLE logs"); if(query.exec()) { if(query.next()) query.value(1).toString(); }To copy to clipboard, switch view to plain text mode
Note that QSqlQuery::lastError() gives -1 means no error!
I'll appreciate for any guidance or help.
Bookmarks